//网络请求
import axios from 'axios';
import AppConfig from '@/constants/AppConfig.js';

const $axios = axios;

export default function() {
	var $app_config = AppConfig();
	var $base_url = $app_config.Base_Url;
	var $post_config = $app_config.POST_Cfg;

	//获取角色列表
	var $url_get_roles = $base_url + "/admin/role/v1/getRoles";
	
	return {
		getRoles: function() {
			return new Promise(function(resolve, reject) {
				$axios.post($url_get_roles, {}, $post_config)
					.then(function(response) {
						console.log(response);
						resolve(response);
					})
					.catch(function(err) {
						reject(err);
					});
			});
		}
	}
}